/**
*
* Super classe Sched
* 
* see <a href="{@docRoot}/Documentation/scheduler.html"> for more information</a>
*  Copyright (c) 2009 Ecole Centrale de Nantes IRCCyN
* @author: Richard
* @version 3.2
*/
package storm.Schedulers;

import report.classSonde;
import storm.Entity;

/**
 * 
 * @author richard
 *
 */
public abstract class Scheduler extends Entity {
	public double overhead;
	public boolean failed;
	
	/**
	 * Scheduler State  
	 */
	public enum States{
		READY,

		WAITING


	}
	States State = States.READY;
	
	public String name="Scheduler";
	public  abstract void select();
	/**
	 * 
	 * @return
	 */
	public int getTickOverhead(){
		return (int) (this.overhead / this.Kernel.getprecision())  ;
	}
	public abstract void sched() ;
		// TODO Auto-generated method stub
		/**
		 * Avant Tick  aprés  timer et message 
		 * Si on appelle un select il est écrasant dernier select possible avant Tick
		 */
	/**
	 * @throws Exception 
	 * 
	 */
	public void init() {
		
		if (this.Kernel.getAllTrace()){
			/**
			 * create file InternalState from sonde
			 */
				 mySonde = new classSonde(this);
			}
	}
	public String getName(){
		return this.name ;
	}

}
